{% if page_obj %}
<div class="pagination">
{% if page_obj.has_previous  %}
  <a  class="prev item" href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
<span class="current item">
    Page {{ page_obj.number }} of {{ paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
  <a class="item next" href="?page={{ page_obj.next_page_number }}">Next</a>
{% endif %}
</div>
{% endif %}
